<template>
  <div id="app">
    <router-view v-if="isRouterAlive"></router-view>
  </div>
</template>

<script>
export default {
  name: 'App',
  components: {},
  provide() {
    return {
      reload: this.reload,
    }
  },
  data() {
    return {
      isRouterAlive: true,
    }
  },
  methods: {
    reload() {
      this.isRouterAlive = false;
      this.$store.commit("reloadReplayId");
      this.$nextTick(() => {
        this.isRouterAlive = true;
      })
    },
  },
  created() {
    /*window.addEventListener("unload",()=>{
      sessionStorage.setItem("blogDetail",JSON.stringify(this.$store.state.blogDetail));
    })*/
  }
}
</script>

<style>
#app {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
</style>
